package zhengqc.queue;

import zhengqc.list.LinkedList;

public class LinkedQueue<E> extends AbstractQueue<E> {
    public LinkedQueue() {
        this.data = new LinkedList<>();
    }
    @Override
    public String toString() {
        E[] array = data.toArray();
        StringBuilder sb = new StringBuilder();
        sb.append("LinkedQueue: size=").append(array.length)
                .append(", content={front->[");
        for (int i = 0; i < array.length; ++i) {
            sb.append(array[i]);
            if ( i != array.length-1 ) {
                sb.append(", ");
            }
        }
        sb.append("]<-rear}");
        return sb.toString();
    }
}
